var WiniisRequest = function () {
};
WiniisRequest.prototype = {
    constructor: WiniisRequest,

    get: function(url, params, success, fail, flag) {
        $.ajax({
            dataType: "json",
            type: "POST",
            url: url,
            data: params,
            async: flag,
            timeout: 30000,
            cache: false,

            success: function (obj) {
                if (obj.result == "failure") {
                    if (fail) {
                        fail(obj);
                    }
                } else {
                    if (success) {
                        success(obj);
                    }
                }
            },
            error: function (jqXHR, textStatus, errorThrown) {
                var result = jqXHR.responseJSON;
                if (fail) {
                    fail(result, jqXHR, textStatus, errorThrown);
                }
            }
        });
    }
};
var winiisRequest = new WiniisRequest();
